﻿using System;

namespace HslCommunication.Core.IMessage
{
	/// <summary>
	/// 异形消息对象，用于异形客户端的注册包接收以及验证使用
	/// </summary>
	// Token: 0x0200014C RID: 332
	public class AlienMessage : INetMessage
	{
		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ProtocolHeadBytesLength" />
		// Token: 0x170005AF RID: 1455
		// (get) Token: 0x06001CBE RID: 7358 RVA: 0x0008CCB4 File Offset: 0x0008AEB4
		public int ProtocolHeadBytesLength
		{
			get
			{
				return 5;
			}
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.HeadBytes" />
		// Token: 0x170005B0 RID: 1456
		// (get) Token: 0x06001CBF RID: 7359 RVA: 0x0008CCB7 File Offset: 0x0008AEB7
		// (set) Token: 0x06001CC0 RID: 7360 RVA: 0x0008CCBF File Offset: 0x0008AEBF
		public byte[] HeadBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ContentBytes" />
		// Token: 0x170005B1 RID: 1457
		// (get) Token: 0x06001CC1 RID: 7361 RVA: 0x0008CCC8 File Offset: 0x0008AEC8
		// (set) Token: 0x06001CC2 RID: 7362 RVA: 0x0008CCD0 File Offset: 0x0008AED0
		public byte[] ContentBytes { get; set; }

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.CheckHeadBytesLegal(System.Byte[])" />
		// Token: 0x06001CC3 RID: 7363 RVA: 0x0008CCDC File Offset: 0x0008AEDC
		public bool CheckHeadBytesLegal(byte[] token)
		{
			bool flag = this.HeadBytes == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = this.HeadBytes[0] == 72 && this.HeadBytes[1] == 115 && this.HeadBytes[2] == 110;
				result = flag2;
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetContentLengthByHeadBytes" />
		// Token: 0x06001CC4 RID: 7364 RVA: 0x0008CD31 File Offset: 0x0008AF31
		public int GetContentLengthByHeadBytes()
		{
			return (int)this.HeadBytes[4];
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetHeadBytesIdentity" />
		// Token: 0x06001CC5 RID: 7365 RVA: 0x00047BE1 File Offset: 0x00045DE1
		public int GetHeadBytesIdentity()
		{
			return 0;
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.SendBytes" />
		// Token: 0x170005B2 RID: 1458
		// (get) Token: 0x06001CC6 RID: 7366 RVA: 0x0008CD3B File Offset: 0x0008AF3B
		// (set) Token: 0x06001CC7 RID: 7367 RVA: 0x0008CD43 File Offset: 0x0008AF43
		public byte[] SendBytes { get; set; }
	}
}
